import 'package:backend.core/core/domain/entities/app_store/app_store_purchased_subscription_price_increase_status.dart';
import 'package:backend.purchases/domain/entities/app_store_api/app_store_api_purchased_subscription_price_increase_status.dart';

abstract class CreateAppStorePurchasedSubscriptionPriceIncreaseStatusFromApiOne {
  AppStorePurchasedSubscriptionPriceIncreaseStatus call({
    required AppStoreApiPurchasedSubscriptionPriceIncreaseStatus apiPriceIncreaseStatus,
  });
}

class CreateAppStorePurchasedSubscriptionPriceIncreaseStatusFromApiOneImpl
    implements CreateAppStorePurchasedSubscriptionPriceIncreaseStatusFromApiOne {
  const CreateAppStorePurchasedSubscriptionPriceIncreaseStatusFromApiOneImpl();

  @override
  AppStorePurchasedSubscriptionPriceIncreaseStatus call({
    required AppStoreApiPurchasedSubscriptionPriceIncreaseStatus apiPriceIncreaseStatus,
  }) {
    switch (apiPriceIncreaseStatus) {
      case AppStoreApiPurchasedSubscriptionPriceIncreaseStatus.absent:
        return AppStorePurchasedSubscriptionPriceIncreaseStatus.absent;
      case AppStoreApiPurchasedSubscriptionPriceIncreaseStatus.accepted:
        return AppStorePurchasedSubscriptionPriceIncreaseStatus.accepted;
      case AppStoreApiPurchasedSubscriptionPriceIncreaseStatus.pending:
        return AppStorePurchasedSubscriptionPriceIncreaseStatus.pending;
    }
  }
}
